class Hadith < Document

  def dorar_url
    url = 'http://www.dorar.net/enc/hadith/'
    body_words = (body||description||rewaya).split
    start_point = body_words.length / 3;
    if body_words.length < 30
      keywords = body_words[start_point, body_words.length]
    else
      keywords = body_words[start_point, start_point]
    end
    url = url + keywords.join('+') + '/+s' + collection.dorar_id.to_s + '+wj'
  end

  def title
    collection.title
  end
  
  def hadith?
    true
  end

end

